<div class="grid_24">
	<div id="search">
		<form id="form_search" action="{{ path(route) }}" method="get" class="panel_no_bordered">
			<div class="first_row">
				<div class="grid_6"><input type="text" name="keyword" id="keyword" value="{{ params.keyword }}" /></div>
				
				<div class="grid_5">
					<select id="categoryId" name="categoryId">
						<option {{ (params.categoryId == 0) ? 'selected=selected' : '' }} value="0">Tất cả danh mục</option>
						{% for category in params.categories %}
							<option {{ (params.categoryId == category.id) ? 'selected=selected' : '' }} value="{{ category.id }}">--- {{category.name}} ---</option>
							{% for child in category.childs %}
								<option {{ (params.categoryId == child.id) ? 'selected=selected' : '' }} value="{{ child.id }}">{{ child.name }}</option>
							{% endfor %}
						{% endfor %}
					</select>
				</div>
				
				<div class="grid_9"><input type="text" name="locality" id="locality" value="{{ params.locality }}" /></div>
				
				<div class=""><button class="button next" type="submit">Tìm kiếm</button></div>
			</div>
			
			<div class="clear"></div>
			
			<div class="second_row">
				<div class="grid_6">
					<label for="orderBy">Xắp xếp theo</label>
					<select id="orderBy" name="orderBy">
						<option {{ (params.orderBy == 'time_desc') ? 'selected=selected' : '' }} value="time_desc">Thời gian giảm dần</option>
						<option {{ (params.orderBy == 'time_asc') ? 'selected=selected' : '' }} value="time_asc">Thời gian tăng dần</option>
						<option {{ (params.orderBy == 'price_desc') ? 'selected=selected' : '' }} value="price_desc">Giá giảm dần</option>
						<option {{ (params.orderBy == 'price_asc') ? 'selected=selected' : '' }} value="price_asc">Giá tăng dần</option>
					</select>
				</div>

				<div class="grid_6">
					<label for="numOf">Trong vòng</label>
					<select id="numOf" name="numOf">
						<option {{ (params.numOf == 0) ? 'selected=selected' : '' }} value="0">Tất cả</option>
						{% for i in 1..6 %}
							<option {{ (params.numOf == i) ? 'selected=selected' : '' }} value="{{ i }}">{{ i }}</option>
						{% endfor %}
					</select>
					<select id="period" name="period">
						<option {{ (params.period == 'day') ? 'selected=selected' : '' }} value="day">ngày</option>
						<option {{ (params.period == 'week') ? 'selected=selected' : '' }} value="week">tuần</option>
						<option {{ (params.period == 'month') ? 'selected=selected' : '' }} value="month">tháng</option>
						<option {{ (params.period == 'year') ? 'selected=selected' : '' }} value="year">năm</option>
					</select>
				</div>
			</div>
			<div class="clear"></div>
		</form>
	</div>
</div>